local PLUGIN = {}
PLUGIN.Title = "Count Bans"
PLUGIN.Description = "Counts a ban by a player"
PLUGIN.Author = "Remscar"
PLUGIN.ChatCommand = "countbans"
PLUGIN.Usage = "<player>"

function PLUGIN:Call( ply, args )

			local uid, pl, nick
		if (#args > 0)
		then
		if ( string.match( args[1] or "", "STEAM_[0-5]:[0-9]:[0-9]+" ) ) then
			uid = evolve:UniqueIDByProperty( "steamid", args[1] )
		else
			pl = evolve:FindPlayer( args[1] )
			if ( #pl > 1 ) then
				evolve:Notify( ply, evolve.colors.white, "Did you mean ", evolve.colors.red, evolve:CreatePlayerList( pl, true ), evolve.colors.white, "?" )
				
				return
				
			elseif ( #pl == 1 ) then
				pl = pl[1]
				uid = pl:UniqueID()
				nick = pl:Nick()
			else
				evolve:Notify( ply, evolve.colors.red, "No Players Found")
			end
		end
		
		
		nick = evolve:GetProperty( uid, "Nick" )
		local bans = tonumber(evolve:PlayerCountBans(uid))
		
		if (bans > 0) then
		
			evolve:Notify(ply, evolve.colors.green, nick .. " has banned ".. bans .. " players.")
			
		else
		
			evolve:Notify(ply, evolve.colors.red, nick .. " has not banned any players!")
			
		end
		end
end

evolve:RegisterPlugin( PLUGIN )